//
//  CreditCardCell.m
//  FuncFanc
//
//  Created by careate-hubing on 2021/5/28.
//  Copyright © 2021 huhu. All rights reserved.
//

#import "CreditCardCell.h"

@interface CreditCardCell ()

@property (nonatomic,strong) UIImageView *cardBG;

@property (nonatomic,strong) UILabel *bankName;

@property (nonatomic,strong) UIImageView *bankImage;

@property (nonatomic,strong) UILabel *cardNum;

@property (nonatomic,strong) UILabel *UserName;

@property (nonatomic,strong) UILabel *总额度;

@property (nonatomic,strong) UILabel *已消费额度;

@property (nonatomic,strong) UILabel *剩余额度;

@end

@implementation CreditCardCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createSubviews];
    }
    return self;
}

-(void)createSubviews
{
    self.cardBG = [[UIImageView alloc]init];
    [self.contentView addSubview:self.cardBG];
    
    self.bankName = [[UILabel alloc]init];
    [self.contentView addSubview:self.bankName];
    
    self.bankImage = [[UIImageView alloc]init];
    [self.contentView addSubview:self.bankImage];
    
    self.cardNum = [[UILabel alloc]init];
    [self.contentView addSubview:self.cardNum];
    
    self.UserName = [[UILabel alloc]init];
    [self.contentView addSubview:self.UserName];
    
    self.总额度 = [[UILabel alloc]init];
    [self.contentView addSubview:self.总额度];
    
    self.已消费额度 = [[UILabel alloc]init];
    [self.contentView addSubview:self.已消费额度];
    
    self.剩余额度 = [[UILabel alloc]init];
    [self.contentView addSubview:self.剩余额度];
    
}

-(void)configCardCellWith:(NSString *)model
{
    
    
    
    
    
}

-(void)layoutSubviews
{
    [self.cardBG mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).offset(1);
    }];
    
    [self.bankName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(20);
        make.width.mas_equalTo(120);
        make.height.mas_equalTo(30);
    }];
    
    [self.cardNum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-120);
        make.top.equalTo(self.bankName.mas_bottom).offset(10);
        make.height.mas_equalTo(30);
    }];
    
    [self.UserName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.bottom.mas_equalTo(-20);
        make.height.mas_equalTo(30);
        make.width.mas_equalTo(80);
    }];
    
    
    [self.总额度 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.bottom.mas_equalTo(-20);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(40);
    }];
    
    [self.已消费额度 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.总额度.mas_right);
        make.bottom.equalTo(self.总额度.mas_top).offset(5);
        make.width.mas_equalTo(1);
        make.height.mas_equalTo(40);
    }];
    
    [self.剩余额度 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.总额度.mas_left);
        make.right.equalTo(self.已消费额度.mas_left);
        make.height.mas_equalTo(40);
        make.bottom.equalTo(self.总额度.mas_top).offset(5);
    }];
   
}





@end
